
package horde.minefield.andres;

import horde.patterns.Core;

/**
 * @author Andres Picazo
 */
public class agentSmithCoreTest extends Core {

    private int internal_value = 0;

    public void sayHi () {
        System.out.println ("Hi!!");
    }

    public void process1 (Integer value) {
        System.out.println ("Got value " + value + " i will do value * 2");
        internal_value = value * 2;
        System.out.println ("Current internal value is " + internal_value);
        System.out.println ("Now i try to get a shared resource...");
        resourceDemo rd = (resourceDemo) requests.getSharedResource("demo");
        if (rd != null) {
            System.out.println ("Using resource:");
            rd.mult(7,4);
        }
        else System.out.println ("Resource 'demo' not available");
    }

    public void process2 () {
        System.out.println ("Got value " + internal_value + " i will do value * 10");
        internal_value = internal_value * 10;
        System.out.println ("Current internal value is " + internal_value);
    }

}
